﻿<UserControl x:Class="VirtualDreams.TurnstileTest.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vd="clr-namespace:VirtualDreams.Turnstile;assembly=VirtualDreams.Turnstile"
    xmlns:tk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
   Width="333" Height="400" FontFamily="Trebuchet MS">
    <UserControl.Resources>
        <SolidColorBrush x:Key="BackgroundBrush" Color="Black" />
        <SolidColorBrush x:Key="AccentBrush" Color="#1BA1E2" />
        <SolidColorBrush x:Key="ApplicationBarBrush" Color="#1F1F1F" />
        <SolidColorBrush x:Key="TextBrush" Color="White" />

        <Style TargetType="Border" x:Key="TileStyle">
            <Setter Property="Background" Value="{StaticResource AccentBrush}" />
            <Setter Property="Margin" Value="0,0,5,5" />
            <Setter Property="Width" Value="88" />
            <Setter Property="Height" Value="88" />
        </Style>
        <Style TargetType="Border" BasedOn="{StaticResource TileStyle}" x:Key="FirstRowTileStyle">
            <Setter Property="Margin" Value="0,47,5,5" />
        </Style>
        <Style TargetType="Border" BasedOn="{StaticResource TileStyle}" x:Key="LargeTileStyle">
            <Setter Property="Width" Value="181" />
        </Style>
        <Style TargetType="Border" BasedOn="{StaticResource TileStyle}" />

        <Style TargetType="TextBlock">
            <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        </Style>
    </UserControl.Resources>
    <Grid Background="{StaticResource ApplicationBarBrush}">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="37"/>
        </Grid.RowDefinitions>
        <Border Style="{x:Null}" Background="{StaticResource BackgroundBrush}">
            <vd:Turnstile x:Name="turnstile">
                <vd:Turnstile.ItemsPanel>
                    <ItemsPanelTemplate>
                        <tk:WrapPanel Margin="13,0,0,0"/>
                    </ItemsPanelTemplate>
                </vd:Turnstile.ItemsPanel>
                <Border Style="{StaticResource FirstRowTileStyle}" />
                <Border Style="{StaticResource FirstRowTileStyle}" />
                <Border Style="{StaticResource FirstRowTileStyle}" />
                <Border />
                <Border Style="{StaticResource LargeTileStyle}" />
                <Border />
                <Border />
                <Border />
                <Border Style="{StaticResource LargeTileStyle}" />
                <Border />
                <Border />
                <Border />
                <Border Style="{StaticResource LargeTileStyle}" />
                <Border />
            </vd:Turnstile>
        </Border>
        <Grid Grid.Row="1" VerticalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="2*" />
                <ColumnDefinition Width="3*" />
                <ColumnDefinition Width="3*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Grid.Column="1">Animate:</TextBlock>
            <HyperlinkButton Click="AnimateTopFront" Grid.Column="2">Top/Front</HyperlinkButton>
            <HyperlinkButton Click="AnimateBottomFront" Grid.Column="3">Bottom/Front</HyperlinkButton>
            <HyperlinkButton Click="AnimateTopBack" Grid.Row="1" Grid.Column="2">Top/Back</HyperlinkButton>
            <HyperlinkButton Click="AnimateBottomBack" Grid.Row="1" Grid.Column="3">Bottom/Back</HyperlinkButton>
        </Grid>
    </Grid>
</UserControl>
